//
//  CCMLoginVC.swift
//  CCMoney_swift
//
//  Created by JKHuang on 2018/11/28.
//  Copyright © 2018 JKHuang. All rights reserved.
//

import UIKit

class CCMLoginVC: CCMBaseViewController {

    fileprivate lazy var loginIcon:UIImageView = {
        let image = UIImageView()
        image.contentMode = .scaleAspectFill
        image.clipsToBounds = true
        return image
    }()
    
    fileprivate lazy var textView:CCMLoginTextFieldView = {
        let view = CCMLoginTextFieldView()
        view.backgroundColor = UIColor.hex(0x202747)
        view.verifyTextField.attributedPlaceholder = NSAttributedString.init(string:"输入验证码", attributes: [
            NSAttributedString.Key.foregroundColor:UIColor.hex(0x666666)])
        view.phoneTextField.attributedPlaceholder = NSAttributedString.init(string:"请输入手机号", attributes: [
            NSAttributedString.Key.foregroundColor:UIColor.hex(0x666666)])
        return view
    }()
    
    fileprivate lazy var commitBut:UIButton = {
        let button = UIButton()
        button.backgroundColor = UIColor.hex(0x5096bd)
        button.setTitle("登录", for: .normal)
        button.setTitleColor(UIColor.white, for: .normal)
        button.titleLabel?.font = UIFont.systemFont(ofSize: 16)
        button.layer.cornerRadius = 5.0
        button.clipsToBounds = true
        button.addTarget(self, action: #selector(clickAction), for: .touchUpInside)
        return button
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()

        title = "登录"
        self.hiddenCustomBack = true
        setUI()
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}

extension CCMLoginVC{
    
    fileprivate func setUI(){
        
        self.view.addSubview(self.loginIcon)
        self.loginIcon.snp.makeConstraints { (make) in
            make.top.equalTo(self.view).offset(17)
            make.centerX.equalTo(self.view)
            make.width.height.equalTo(95)
        }
        self.loginIcon.image = UIImage(named: "logo_icon")
        
        self.view.addSubview(self.textView)
        self.textView.snp.makeConstraints { (make) in
            make.top.equalTo(self.loginIcon.snp_bottomMargin).offset(16)
            make.leading.trailing.equalTo(self.view)
            make.height.equalTo(98)
        }
        
        self.view.addSubview(self.commitBut)
        self.commitBut.snp.makeConstraints { (make) in
            make.top.equalTo(textView.snp_bottomMargin).offset(51)
            make.leading.equalTo(self.view).offset(20)
            make.trailing.equalTo(self.view).offset(-20)
            make.height.equalTo(44)
        }
    }
    
    @objc fileprivate func clickAction(){
        
    }
}
